package com.ac.scum.log.bean;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

@Data
@TableName("player_alarm_pushed")
@EqualsAndHashCode(callSuper = true)
public class PlayerAlarmPushed extends PlayerAlarm {
    private LocalDateTime pushTime;


    public PlayerAlarmError PushedErrorEntity(String error) {
        PlayerAlarmError playerAlarmError = new PlayerAlarmError();
        playerAlarmError.setServerId(getServerId());
        playerAlarmError.setPlayerId(getPlayerId());
        playerAlarmError.setDetail(getDetail());
        playerAlarmError.setLogId(getLogId());
        playerAlarmError.setLogTime(getLogTime());
        playerAlarmError.setServerName(getServerName());
        playerAlarmError.setAlarmDetail(getAlarmDetail());
        playerAlarmError.setAlarmItem(getAlarmItem());
        playerAlarmError.setErrorMessage(error);
        playerAlarmError.setPushTime(LocalDateTime.now());
        return playerAlarmError;
    }
}
